package activity

import (
	"gdshop-back-end-go/admin-api/app/controllers"
	"gdshop-back-end-go/admin-api/app/service/GoodsActivityService"
	"gdshop-back-end-go/common/request/BaseReq"
	"gdshop-back-end-go/common/response"
	"github.com/gogf/gf/net/ghttp"
)

// GoodsActivityController 活动
type GoodsActivityController struct {
	*ActivityBaseController
}

func NewGoodsActivityController(inputReq *BaseReq.I) *GoodsActivityController {
	return &GoodsActivityController{
		&ActivityBaseController{&controllers.BaseController{Req: inputReq}},
	}
}

func (c *GoodsActivityController) SetStatus(r *ghttp.Request) *response.JsonResponse {
	if err := c.checkIds(r); err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	}
	return GoodsActivityService.SetStatus(r, c.Req)
}

func (c *GoodsActivityController) GetRule(r *ghttp.Request) *response.JsonResponse {
	if err := c.checkIds(r); err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	}
	return GoodsActivityService.GetRule(r, c.Req)
}

func (c *GoodsActivityController) SetRule(r *ghttp.Request) *response.JsonResponse {
	return GoodsActivityService.SetRule(r, c.Req)
}

func (c *GoodsActivityController) GetExcludeGoodsSelects(r *ghttp.Request) *response.JsonResponse {
	if err := c.checkIds(r); err != nil {
		return response.FailByRequestMessage(nil, err.Error())
	}
	return GoodsActivityService.GetExcludeGoodsSelects(r, c.Req)
}
